/*
 * @Author: gaopengge
 * @Date: 2023-02-25 11:44:42
 * @Last Modified by: gaopengge
 * @Last Modified time: 2023-02-25 13:22:19
 * @description API管理  /admin/acl/index/login
 */
//引入axios
import request from '@/utils/request';
//登录接口需要携带的请求体参数-对象--配置参数类型
import type {
	loginData,
	loginResponseData,
	userInfoResponseData,
} from './model/user';

//枚举  api相关接口
enum API {
	//登录
	LOGIN = '/admin/acl/index/login',
	//获取用户信息
	USERINFO = '/admin/acl/index/info',
	//退出登录
	LOGOUT = '/admin/acl/index/logout',
}

//分别暴漏接口

//登录接口
export const reqLogin = (data: loginData) =>
	request.post<any, loginResponseData>(API.LOGIN, data);
//获取用户信息
export const reqUserInfo = () =>
	request.get<any, userInfoResponseData>(API.USERINFO);
//退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT);
